package com.stagesmsserver.smsserver.controller;

import com.stagecommon.common.pojo.RespBean;
import com.stagecommon.common.dto.SmsCodeReq;
import com.stagesmsserver.smsserver.service.SmsSendCodeService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.concurrent.CompletableFuture;

/**
 * @description：发送短信控制
 * @author： SAYE
 * @create： 2024/4/20 21:02
 */
@RestController
@RequestMapping("/sms")
@Slf4j
public class SmsController {

    @Autowired
    private SmsSendCodeService sendCodeService;

    @PostMapping("/sendCode")
    public CompletableFuture<RespBean<Object>> sendCode(@RequestBody SmsCodeReq smsCodeReq) {
        return sendCodeService.sendCode(smsCodeReq);
    }

}

